import { ref, reactive, computed, toRef } from 'vue'
import { defineStore } from 'pinia'

export const useCommonStore = defineStore('common', () => {
	const state = reactive({
		showGlobalPop: {
			show: false,
			showCancelButton: true
		} as any,
	})
	
	// 公共弹框
	function toShowGlobalPop(obj: object) {
		state.showGlobalPop = Object.assign(state.showGlobalPop, obj)
	}

	return { 
		showGlobalPop: state.showGlobalPop, 
		toShowGlobalPop
	}
})
